<!DOCTYPE html>

<html lang="zh-Hans">
  <head>
    <meta charset="utf-8" />
    <meta name="author" content="rogepi" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="/vue.global.js"></script>
    <title>4-two-way-binding</title>
  </head>

  <body>
    <!-- Vue 还提供了 v-model 指令，
    它能轻松实现表单输入和应用状态之间的双向绑定。 -->
    <div id="two-way-binding">
      <p>{{message}}</p>
      <input v-model="message" />
    </div>
    <script>
      const TwoWayBinding = {
        data() {
          return {
            message: 'Hello Vue!',
          };
        },
      };
      Vue.createApp(TwoWayBinding).mount('#two-way-binding');
    </script>
  </body>
</html>
